package object;

public class Dog {
    public String name;
    public String category;
    public int age;
    public void bark(){
        System.out.println("汪汪汪");
    }
    public void eat(String food){
        System.out.println(name + "正在吃" + food);
    }
    public void sleep(){
        System.out.println("正在睡觉");
    }

    public static void main(String[] args) {
        Dog dog = new Dog();//与Scanner类似
        dog.name = "大黄";
        System.out.println(dog.name);//紫色的是成员变量
        dog.bark();
        dog.eat("狗粮");

        Dog dog2 = new Dog();
        dog2.name = "毛毛";
        System.out.println(dog2.name);
        dog2.bark();
        dog2.eat("肉");
    }

}

